<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Jetson Inference: Socket Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="NVLogo_2D.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Jetson Inference
   </div>
   <div id="projectbrief">DNN Vision Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classSocket.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classSocket-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Socket Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>The <a class="el" href="classSocket.html" title="The Socket class provides TCP or UDP ethernet networking. ">Socket</a> class provides TCP or UDP ethernet networking.  
 <a href="classSocket.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="Socket_8h_source.html">Socket.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aeac4eb6379a543d38ed88977d3b6630a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#aeac4eb6379a543d38ed88977d3b6630a">~Socket</a> ()</td></tr>
<tr class="memdesc:aeac4eb6379a543d38ed88977d3b6630a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#aeac4eb6379a543d38ed88977d3b6630a">More...</a><br /></td></tr>
<tr class="separator:aeac4eb6379a543d38ed88977d3b6630a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3fb80aa2f7ab74d371fe045bc1312ee"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#ae3fb80aa2f7ab74d371fe045bc1312ee">Accept</a> (uint64_t timeout=0)</td></tr>
<tr class="memdesc:ae3fb80aa2f7ab74d371fe045bc1312ee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Accept incoming connections (TCP only).  <a href="#ae3fb80aa2f7ab74d371fe045bc1312ee">More...</a><br /></td></tr>
<tr class="separator:ae3fb80aa2f7ab74d371fe045bc1312ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3935a15fa982064c2cb35996a2d6ef3d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#a3935a15fa982064c2cb35996a2d6ef3d">Bind</a> (const char *localIP, uint16_t port)</td></tr>
<tr class="memdesc:a3935a15fa982064c2cb35996a2d6ef3d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bind the socket to a local host IP address and port.  <a href="#a3935a15fa982064c2cb35996a2d6ef3d">More...</a><br /></td></tr>
<tr class="separator:a3935a15fa982064c2cb35996a2d6ef3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27b61fa80a52fe2a3cd8e53490f87371"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#a27b61fa80a52fe2a3cd8e53490f87371">Bind</a> (uint32_t localIP, uint16_t port)</td></tr>
<tr class="memdesc:a27b61fa80a52fe2a3cd8e53490f87371"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bind the socket to a local host IP address and port.  <a href="#a27b61fa80a52fe2a3cd8e53490f87371">More...</a><br /></td></tr>
<tr class="separator:a27b61fa80a52fe2a3cd8e53490f87371"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb916cc93bb51552ec6181890189c10b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#adb916cc93bb51552ec6181890189c10b">Bind</a> (uint16_t port=0)</td></tr>
<tr class="memdesc:adb916cc93bb51552ec6181890189c10b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bind the socket to a local host port, on any interface (0.0.0.0 INADDR_ANY).  <a href="#adb916cc93bb51552ec6181890189c10b">More...</a><br /></td></tr>
<tr class="separator:adb916cc93bb51552ec6181890189c10b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae52ee0bd9db277eee9324ed8da312bc7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#ae52ee0bd9db277eee9324ed8da312bc7">Connect</a> (const char *remoteIP, uint16_t port)</td></tr>
<tr class="memdesc:ae52ee0bd9db277eee9324ed8da312bc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect to a listening server (TCP only).  <a href="#ae52ee0bd9db277eee9324ed8da312bc7">More...</a><br /></td></tr>
<tr class="separator:ae52ee0bd9db277eee9324ed8da312bc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa166710a82dfd4c8a594b2f8fb36dc7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#aaa166710a82dfd4c8a594b2f8fb36dc7">Connect</a> (uint32_t remoteIP, uint16_t port)</td></tr>
<tr class="memdesc:aaa166710a82dfd4c8a594b2f8fb36dc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect to a listening server (TCP only).  <a href="#aaa166710a82dfd4c8a594b2f8fb36dc7">More...</a><br /></td></tr>
<tr class="separator:aaa166710a82dfd4c8a594b2f8fb36dc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a30b5c0d94e1477859a1b05ce9cd2bedf"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#a30b5c0d94e1477859a1b05ce9cd2bedf">Recieve</a> (uint8_t *buffer, size_t size, uint32_t *remoteIP=NULL, uint16_t *remotePort=NULL)</td></tr>
<tr class="memdesc:a30b5c0d94e1477859a1b05ce9cd2bedf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait for a packet to be recieved and dump it into the user-supplied buffer.  <a href="#a30b5c0d94e1477859a1b05ce9cd2bedf">More...</a><br /></td></tr>
<tr class="separator:a30b5c0d94e1477859a1b05ce9cd2bedf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf5d5e11719d38cc656cd36e8c8dd9be"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#abf5d5e11719d38cc656cd36e8c8dd9be">Recieve</a> (uint8_t *buffer, size_t size, uint32_t *remoteIP, uint16_t *remotePort, uint32_t *localIP)</td></tr>
<tr class="memdesc:abf5d5e11719d38cc656cd36e8c8dd9be"><td class="mdescLeft">&#160;</td><td class="mdescRight">Recieve packet, with additional address info.  <a href="#abf5d5e11719d38cc656cd36e8c8dd9be">More...</a><br /></td></tr>
<tr class="separator:abf5d5e11719d38cc656cd36e8c8dd9be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a899ae7dea24300c0c11ffc908f428f76"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#a899ae7dea24300c0c11ffc908f428f76">Send</a> (void *buffer, size_t size, uint32_t remoteIP, uint16_t remotePort)</td></tr>
<tr class="memdesc:a899ae7dea24300c0c11ffc908f428f76"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send message to remote host.  <a href="#a899ae7dea24300c0c11ffc908f428f76">More...</a><br /></td></tr>
<tr class="separator:a899ae7dea24300c0c11ffc908f428f76"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a74faf2bdb3116dc69164549465bfb638"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#a74faf2bdb3116dc69164549465bfb638">SetRecieveTimeout</a> (uint64_t timeout)</td></tr>
<tr class="memdesc:a74faf2bdb3116dc69164549465bfb638"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set Receive() timeout (in microseconds).  <a href="#a74faf2bdb3116dc69164549465bfb638">More...</a><br /></td></tr>
<tr class="separator:a74faf2bdb3116dc69164549465bfb638"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a453d33c92c88a15b0d93601ef9f067aa"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#a453d33c92c88a15b0d93601ef9f067aa">SetBufferSize</a> (size_t size)</td></tr>
<tr class="memdesc:a453d33c92c88a15b0d93601ef9f067aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the rx/tx buffer sizes.  <a href="#a453d33c92c88a15b0d93601ef9f067aa">More...</a><br /></td></tr>
<tr class="separator:a453d33c92c88a15b0d93601ef9f067aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a90ff068da1fa6e1a28a014adca9efd74"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#a90ff068da1fa6e1a28a014adca9efd74">EnableJumboBuffer</a> ()</td></tr>
<tr class="memdesc:a90ff068da1fa6e1a28a014adca9efd74"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable jumbo buffer.  <a href="#a90ff068da1fa6e1a28a014adca9efd74">More...</a><br /></td></tr>
<tr class="separator:a90ff068da1fa6e1a28a014adca9efd74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af8e832813b2d414478b83e898cd88e30"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#af8e832813b2d414478b83e898cd88e30">GetFD</a> () const</td></tr>
<tr class="memdesc:af8e832813b2d414478b83e898cd88e30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the socket's file descriptor.  <a href="#af8e832813b2d414478b83e898cd88e30">More...</a><br /></td></tr>
<tr class="separator:af8e832813b2d414478b83e898cd88e30"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7c5d363579140822d7477b21df0ca1e7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="Socket_8h.html#aa78c7398fa81f7f62aa233159d4d8d97">SocketType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#a7c5d363579140822d7477b21df0ca1e7">GetType</a> () const</td></tr>
<tr class="memdesc:a7c5d363579140822d7477b21df0ca1e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">GetType.  <a href="#a7c5d363579140822d7477b21df0ca1e7">More...</a><br /></td></tr>
<tr class="separator:a7c5d363579140822d7477b21df0ca1e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a1a0827f962d665cbcd8fe363c2f411"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#a2a1a0827f962d665cbcd8fe363c2f411">PrintIP</a> () const</td></tr>
<tr class="memdesc:a2a1a0827f962d665cbcd8fe363c2f411"><td class="mdescLeft">&#160;</td><td class="mdescRight">PrintIP.  <a href="#a2a1a0827f962d665cbcd8fe363c2f411">More...</a><br /></td></tr>
<tr class="separator:a2a1a0827f962d665cbcd8fe363c2f411"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4e9d1c14216315b46e2ab531735eec45"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#a4e9d1c14216315b46e2ab531735eec45">GetMTU</a> ()</td></tr>
<tr class="memdesc:a4e9d1c14216315b46e2ab531735eec45"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the MTU (in bytes).  <a href="#a4e9d1c14216315b46e2ab531735eec45">More...</a><br /></td></tr>
<tr class="separator:a4e9d1c14216315b46e2ab531735eec45"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a400f9fdf31e5d6738fcb33f7dd6464a3"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classSocket.html">Socket</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#a400f9fdf31e5d6738fcb33f7dd6464a3">Create</a> (<a class="el" href="Socket_8h.html#aa78c7398fa81f7f62aa233159d4d8d97">SocketType</a> type)</td></tr>
<tr class="memdesc:a400f9fdf31e5d6738fcb33f7dd6464a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create.  <a href="#a400f9fdf31e5d6738fcb33f7dd6464a3">More...</a><br /></td></tr>
<tr class="separator:a400f9fdf31e5d6738fcb33f7dd6464a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The <a class="el" href="classSocket.html" title="The Socket class provides TCP or UDP ethernet networking. ">Socket</a> class provides TCP or UDP ethernet networking. </p>
<p>To exchange data with a remote IP on the network using UDP, follow these steps: </p><pre class="fragment">    1.  Create a Socket instance with the static Create() function.
</pre><ol type="1">
<li><a class="el" href="classSocket.html#a3935a15fa982064c2cb35996a2d6ef3d" title="Bind the socket to a local host IP address and port. ">Bind()</a> the <a class="el" href="classSocket.html" title="The Socket class provides TCP or UDP ethernet networking. ">Socket</a> to a host IP address and port</li>
<li>Exchange data with the Send/Recv functions </li>
</ol>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="aeac4eb6379a543d38ed88977d3b6630a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeac4eb6379a543d38ed88977d3b6630a">&#9670;&nbsp;</a></span>~Socket()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Socket::~Socket </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destructor. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ae3fb80aa2f7ab74d371fe045bc1312ee"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae3fb80aa2f7ab74d371fe045bc1312ee">&#9670;&nbsp;</a></span>Accept()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Socket::Accept </td>
          <td>(</td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>timeout</em> = <code>0</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Accept incoming connections (TCP only). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">timeout</td><td>The timeout (in microseconds) to wait for incoming connections before returning. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a3935a15fa982064c2cb35996a2d6ef3d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3935a15fa982064c2cb35996a2d6ef3d">&#9670;&nbsp;</a></span>Bind() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Socket::Bind </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>localIP</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>port</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Bind the socket to a local host IP address and port. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ipAddress</td><td>IPv4 address in string format "xxx.xxx.xxx.xxx" </td></tr>
    <tr><td class="paramname">port</td><td>the port number (0-65536), in host byte order. If the port specified is 0, the socket will be bound to any available port. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a27b61fa80a52fe2a3cd8e53490f87371"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a27b61fa80a52fe2a3cd8e53490f87371">&#9670;&nbsp;</a></span>Bind() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Socket::Bind </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>localIP</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>port</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Bind the socket to a local host IP address and port. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hostIP</td><td>IPv4 address, in network byte order. If htonl(INADDR_ANY) is specified for the ipAddress, the socket will be bound to all available interfaces. </td></tr>
    <tr><td class="paramname">port</td><td>the port number (0-65536), in host byte order. If the port specified is 0, the socket will be bound to any available port. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="adb916cc93bb51552ec6181890189c10b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adb916cc93bb51552ec6181890189c10b">&#9670;&nbsp;</a></span>Bind() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Socket::Bind </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>port</em> = <code>0</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Bind the socket to a local host port, on any interface (0.0.0.0 INADDR_ANY). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">port</td><td>the port number (0-65536), in host byte order. If the port specified is 0, the socket will be bound to any available port. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ae52ee0bd9db277eee9324ed8da312bc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae52ee0bd9db277eee9324ed8da312bc7">&#9670;&nbsp;</a></span>Connect() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Socket::Connect </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>remoteIP</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>port</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connect to a listening server (TCP only). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">remoteIP</td><td>IP address of the remote host. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aaa166710a82dfd4c8a594b2f8fb36dc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaa166710a82dfd4c8a594b2f8fb36dc7">&#9670;&nbsp;</a></span>Connect() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Socket::Connect </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>remoteIP</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>port</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connect to a listening server (TCP only). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">remoteIP</td><td>IP address of the remote host. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a400f9fdf31e5d6738fcb33f7dd6464a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a400f9fdf31e5d6738fcb33f7dd6464a3">&#9670;&nbsp;</a></span>Create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classSocket.html">Socket</a>* Socket::Create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="Socket_8h.html#aa78c7398fa81f7f62aa233159d4d8d97">SocketType</a>&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Create. </p>

</div>
</div>
<a id="a90ff068da1fa6e1a28a014adca9efd74"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a90ff068da1fa6e1a28a014adca9efd74">&#9670;&nbsp;</a></span>EnableJumboBuffer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Socket::EnableJumboBuffer </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enable jumbo buffer. </p>

</div>
</div>
<a id="af8e832813b2d414478b83e898cd88e30"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af8e832813b2d414478b83e898cd88e30">&#9670;&nbsp;</a></span>GetFD()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int Socket::GetFD </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Retrieve the socket's file descriptor. </p>

</div>
</div>
<a id="a4e9d1c14216315b46e2ab531735eec45"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4e9d1c14216315b46e2ab531735eec45">&#9670;&nbsp;</a></span>GetMTU()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t Socket::GetMTU </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieve the MTU (in bytes). </p>
<p>Returns 0 on error. </p>

</div>
</div>
<a id="a7c5d363579140822d7477b21df0ca1e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7c5d363579140822d7477b21df0ca1e7">&#9670;&nbsp;</a></span>GetType()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="Socket_8h.html#aa78c7398fa81f7f62aa233159d4d8d97">SocketType</a> Socket::GetType </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>GetType. </p>

</div>
</div>
<a id="a2a1a0827f962d665cbcd8fe363c2f411"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2a1a0827f962d665cbcd8fe363c2f411">&#9670;&nbsp;</a></span>PrintIP()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Socket::PrintIP </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>PrintIP. </p>

</div>
</div>
<a id="a30b5c0d94e1477859a1b05ce9cd2bedf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a30b5c0d94e1477859a1b05ce9cd2bedf">&#9670;&nbsp;</a></span>Recieve() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t Socket::Recieve </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>remoteIP</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t *&#160;</td>
          <td class="paramname"><em>remotePort</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Wait for a packet to be recieved and dump it into the user-supplied buffer. </p>
<p>Optionally return the IP address and port of the remote host which sent the packet. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>user-allocated destination for the packet </td></tr>
    <tr><td class="paramname">size</td><td>size of the buffer (in bytes) </td></tr>
    <tr><td class="paramname">remoteIpAddress</td><td>optional output, the IPv4 address of where the packet originated (in network byte order). </td></tr>
    <tr><td class="paramname">remotePort</td><td>optional output, the port from where the packet originated (in host byte order). </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the size (in bytes) of the packet sucessfully written to buffer. </dd></dl>

</div>
</div>
<a id="abf5d5e11719d38cc656cd36e8c8dd9be"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf5d5e11719d38cc656cd36e8c8dd9be">&#9670;&nbsp;</a></span>Recieve() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t Socket::Recieve </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>remoteIP</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t *&#160;</td>
          <td class="paramname"><em>remotePort</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>localIP</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Recieve packet, with additional address info. </p>
<p>In addition to returning the IP and port of the remote host which sent the packet, this function can also return the local IP and port which the packet was sent to. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="classSocket.html#a30b5c0d94e1477859a1b05ce9cd2bedf" title="Wait for a packet to be recieved and dump it into the user-supplied buffer. ">Recieve()</a> </dd></dl>

</div>
</div>
<a id="a899ae7dea24300c0c11ffc908f428f76"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a899ae7dea24300c0c11ffc908f428f76">&#9670;&nbsp;</a></span>Send()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Socket::Send </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>remoteIP</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>remotePort</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send message to remote host. </p>

</div>
</div>
<a id="a453d33c92c88a15b0d93601ef9f067aa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a453d33c92c88a15b0d93601ef9f067aa">&#9670;&nbsp;</a></span>SetBufferSize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Socket::SetBufferSize </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the rx/tx buffer sizes. </p>

</div>
</div>
<a id="a74faf2bdb3116dc69164549465bfb638"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a74faf2bdb3116dc69164549465bfb638">&#9670;&nbsp;</a></span>SetRecieveTimeout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Socket::SetRecieveTimeout </td>
          <td>(</td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>timeout</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set Receive() timeout (in microseconds). </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>jetson-utils/<a class="el" href="Socket_8h_source.html">Socket.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="classSocket.html">Socket</a></li>
    <li class="footer">Generated on Fri Jun 21 2019 16:23:15 for Jetson Inference by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
